Kernel Patch apply issue #poky #raspberrypi
Hi,
I am trying to build yocto image for raspberrypi, with realsense enabled. I have taken the realsense uvcvideo patches.
While trying to build i get the following message:
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0 do_patch: Could not apply patches for raspberrypi4-64.
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0 do_patch: Patch failures can be resolved in the linux source directory /home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source)
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0 do_patch: Execution of '/home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/run.do_patch.29421' failed with exit code 1:
(1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch
(2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch
(3/6) realsense_hid_5.4.patch
(4/6) realsense_metadata_5.4.patch
(5/6) realsense_powerlinefrequency_control_fix_5.4.patch
(6/6) realsense_camera_formats_5.4.patch
[INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context.
[INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply".
error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330
error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply
error: patch failed: include/uapi/linux/videodev2.h:727
error: include/uapi/linux/videodev2.h: patch does not apply
[ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed.
Patch needs to be refreshed. Sample resolution script:
.git/rebase-apply/resolve_rejects
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/log.do_patch.29421 Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot | NOTE: Direct dependencies are ['/home/aravind2/work/project-yocto/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/aravind2/work/project-yocto/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/aravind2/work/project-yocto/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot'] | NOTE: Installed into sysroot: [] | NOTE: Skipping as already exists in sysroot: ['kern-tools-native', 'quilt-native', 'patch-native', 'gnu-config-native', 'automake-native', 'attr-native', 'libtool-native', 'autoconf-native', 'texinfo-dummy-native', 'gettext-minimal-native', 'm4-native'] | DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_patch | (1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch | (2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch | (3/6) realsense_hid_5.4.patch | (4/6) realsense_metadata_5.4.patch | (5/6) realsense_powerlinefrequency_control_fix_5.4.patch | (6/6) realsense_camera_formats_5.4.patch | [INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context. | [INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply". | error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330 | error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply | error: patch failed: include/uapi/linux/videodev2.h:727 | error: include/uapi/linux/videodev2.h: patch does not apply | [ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed. | Patch needs to be refreshed. Sample resolution script: | .git/rebase-apply/resolve_rejects | ERROR: Could not apply patches for raspberrypi4-64. | ERROR: Patch failures can be resolved in the linux source directory /home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source) | WARNING: exit code 1 from a shell command. | ERROR: Execution of '/home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/run.do_patch.29421' failed with exit code 1: | (1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch | (2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch | (3/6) realsense_hid_5.4.patch | (4/6) realsense_metadata_5.4.patch | (5/6) realsense_powerlinefrequency_control_fix_5.4.patch | (6/6) realsense_camera_formats_5.4.patch | [INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context. | [INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply". | error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330 | error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply | error: patch failed: include/uapi/linux/videodev2.h:727 | error: include/uapi/linux/videodev2.h: patch does not apply | [ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed. | Patch needs to be refreshed. Sample resolution script: | .git/rebase-apply/resolve_rejects | WARNING: exit code 1 from a shell command. |
ERROR: Task (/home/aravind2/work/project-yocto/poky/../meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 717 tasks of which 706 didn't need to be rerun and 1 failed.
NOTE: No commit since BUILDHISTORY_COMMIT != '1'
Summary: 1 task failed:
/home/aravind2/work/project-yocto/poky/../meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb:do_patch
But i am able to apply the failing patch without any issue on https://github.com/raspberrypi/linux/tree/rpi-5.4.y and also at /home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source.
I recreated the patch multiple times from the kernel-source directory of my build tree, but it always fails.
I try git am --abort and then apply again the patch it succeeds without any issue.
But while building from bitbake, it is always failing.
What could be the issue? Could you please help me?
regards
Arun
Hi Arun,
Quoted 79 lines · Arun Ravindran
Hi,
I am trying to build yocto image for raspberrypi, with realsense enabled. I have taken the realsense uvcvideo patches.
While trying to build i get the following message:
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0
do_patch: Could not apply patches for raspberrypi4-64.
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0do_patch: Patch failures can be resolved in the linux source directory/home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source)
ERROR: linux-raspberrypi-1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0do_patch: Execution of '/home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/run.do_patch.29421' failed with exit code 1:
(1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch
(2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch
(3/6) realsense_hid_5.4.patch
(4/6) realsense_metadata_5.4.patch
(5/6) realsense_powerlinefrequency_control_fix_5.4.patch
(6/6) realsense_camera_formats_5.4.patch
[INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context.
[INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply".
error: patch failed:drivers/media/v4l2-core/v4l2-ioctl.c:1330
error:drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply
error: patch failed:include/uapi/linux/videodev2.h:727
error:include/uapi/linux/videodev2.h: patch does not apply
[ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed.
Patch needs to be refreshed. Sample resolution script:
.git/rebase-apply/resolve_rejects
WARNING: exit code 1 from a shell command.ERROR: Logfile of failure stored in:
/home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/log.do_patch.29421Log data follows:| DEBUG: Executing python function extend_recipe_sysroot | NOTE: Direct dependencies are ['/home/aravind2/work/project-yocto/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/aravind2/work/project-yocto/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/aravind2/work/project-yocto/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot'] | NOTE: Installed into sysroot: [] | NOTE: Skipping as already exists in sysroot: ['kern-tools-native', 'quilt-native', 'patch-native', 'gnu-config-native', 'automake-native', 'attr-native', 'libtool-native', 'autoconf-native', 'texinfo-dummy-native', 'gettext-minimal-native', 'm4-native'] | DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_patch | (1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch | (2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch | (3/6) realsense_hid_5.4.patch | (4/6) realsense_metadata_5.4.patch | (5/6) realsense_powerlinefrequency_control_fix_5.4.patch | (6/6) realsense_camera_formats_5.4.patch | [INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context. | [INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply". | error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330 | error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply | error: patch failed: include/uapi/linux/videodev2.h:727 | error: include/uapi/linux/videodev2.h: patch does not apply | [ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed. | Patch needs to be refreshed. Sample resolution script: | .git/rebase-apply/resolve_rejects | ERROR: Could not apply patches for raspberrypi4-64. | ERROR: Patch failures can be resolved in the linux source directory /home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source) | WARNING: exit code 1 from a shell command. | ERROR: Execution of '/home/aravind2/work/project-yocto/mvdevice/build/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.72+gitAUTOINC+5d52d9eea9_154de7bbd5-r0/temp/run.do_patch.29421' failed with exit code 1: | (1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch | (2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch | (3/6) realsense_hid_5.4.patch | (4/6) realsense_metadata_5.4.patch | (5/6) realsense_powerlinefrequency_control_fix_5.4.patch | (6/6) realsense_camera_formats_5.4.patch | [INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context. | [INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply". | error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330 | error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply | error: patch failed: include/uapi/linux/videodev2.h:727 | error: include/uapi/linux/videodev2.h: patch does not apply | [ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed. | Patch needs to be refreshed. Sample resolution script: | .git/rebase-apply/resolve_rejects | WARNING: exit code 1 from a shell command. |ERROR: Task (/home/aravind2/work/project-yocto/poky/../meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 717 tasks of which 706 didn't need to be rerun and 1 failed.
NOTE: No commit sinceBUILDHISTORY_COMMIT!= '1'Summary: 1 task failed:
/home/aravind2/work/project-yocto/poky/../meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb:do_patchBut i am able to apply the failing patch without any issue on https://github.com/raspberrypi/linux/tree/rpi-5.4.y and also at
/home/aravind2/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source.
Quoted 8 lines
I recreated the patch multiple times from the kernel-source directory of my build tree, but it always fails.
I try git am --abort and then apply again the patch it succeeds without any issue.
But while building from bitbake, it is always failing.
What could be the issue? Could you please help me?
By default the tool used to apply patches in Yocto is quilt IIRC. You can try to switch to git and see if it helps:
PATCHTOOL = "git"
in your kernel recipe bbappend.
Cheers,
Quentin
Quoted 2 lines · Quentin Schulz
PATCHTOOL = "git"
After putting the above, still the same result.
| (1/6) 0001-Revert-selftests-bpf-Skip-perf-hw-events-test-if-the.patch | (2/6) 0002-Revert-selftests-bpf-Fix-perf_buffer-test-on-systems.patch | (3/6) realsense_hid_5.4.patch | (4/6) realsense_metadata_5.4.patch | (5/6) realsense_powerlinefrequency_control_fix_5.4.patch | (6/6) realsense_camera_formats_5.4.patch | [INFO]: check of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not pass, trying reduced context. | [INFO]: Context reduced git-am of .kernel-meta//patches///realsense_camera_formats_5.4.patch with "git am" did not work, trying "apply". | error: patch failed: drivers/media/v4l2-core/v4l2-ioctl.c:1330 | error: drivers/media/v4l2-core/v4l2-ioctl.c: patch does not apply | error: patch failed: include/uapi/linux/videodev2.h:727 | error: include/uapi/linux/videodev2.h: patch does not apply | [ERROR]: Application of .kernel-meta//patches///realsense_camera_formats_5.4.patch failed. | Patch needs to be refreshed. Sample resolution script: | .git/rebase-apply/resolve_rejects | WARNING: exit code 1 from a shell command. | | ERROR: Task (/home/aravind2/work/project-yocto/poky/../meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bb:do_patch) failed with exit code '1' | NOTE: Tasks Summary: Attempted 717 tasks of which 706 didn't need to be rerun and 1 failed.
But here, i can apply the patch without any issue...
| aravind2@tmsbuild012:~/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source$ git am --abort | aravind2@tmsbuild012:~/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source$ git am /home/aravind2/work/project-yocto/meta-intel-realsense/recipes-kernel/linux/linux-raspberrypi/realsense_camera_formats_5.4.patch |Applying: Add support for RealSense camera formats | aravind2@tmsbuild012:~/work/project-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source$ ( aravind2@tmsbuild012:~/work/mevolve-yocto/mvdevice/build/tmp/work-shared/raspberrypi4-64/kernel-source$ )
regards
Arun
Hi,
I followed the steps from https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe and the issue is resolved. Now patches are applying correctly..
regards